package com.stone.design.patterns.factory;

/**
 * @description
 * @Time 2018/4/2 12:56
 * Created by Stone on 2018/4/2.
 */

public class ConCreateFactory extends Factory<Product> {
    @Override
    public <T extends Product> T createProduct(Class<T> clz) {

        Product p = null;
        try {
            p = (Product) Class.forName(clz.getName()).newInstance();
        } catch (Exception e) {
            e.printStackTrace();
        }
        return (T) p;
    }
}
